#pragma once

#include <QWidget>
#include "ui_stretchWidget.h"
#include "modelSoft.h"
#include <TopoDS_Edge.hxx>
#include <stretchFeature.h>

QT_BEGIN_NAMESPACE
namespace Ui { class stretchWidgetClass; };
QT_END_NAMESPACE

class stretchWidget : public QWidget
{
	Q_OBJECT

public:
	stretchWidget(modelSoft *myModelSoft, QWidget *parent = nullptr);
	~stretchWidget();
protected:
	void createConnection();
	void onClickModify();
	virtual void closeEvent(QCloseEvent* event) override;
	void onClickConfirm();
	//void onClickCancel();
	void onClickSelect();
	void onClickCancelSelect();
	void typeChange(int type);

public:
	void receiveStretchSelectedShape(const TopoDS_Shape& subShape, Handle(QIVtkSelectionPipeline) pipeline);

private:
	Ui::stretchWidgetClass *ui;
	modelSoft* myModelSoft;
	//0:Vertex 1:Edge 2:Face
	int typeTag;
	bool isModified;
	TopoDS_Shape selectShape;
	StretchFeature* stretchFeature;
	Handle(QIVtkSelectionPipeline) resultPipeline;
	bool confirmCreated = false;
	bool targetReceive = false;
};
